<?php
require_model('base.class');
class doctorAssistant extends base {
    private $table = 'DoctorAssistant';
    private $primary = 'AssistantId';
    function __construct() {
        parent::__construct($this->table,$this->primary);
    }
    function CreateAssistant($params) {
        return $this->insert_item($params);
    }
    function DeleteAssistant($assistantId) {
        return $this->delete_item($assistantId);
    }
    function ConfirmAssistant($assistantId, $confirmStatus) {
        return $this->update_item(array('IsConfirmed'=>$confirmStatus) ,array('AssistantId'=>$assistantId));
    }
    function GetAssistantByDoctorUserName($username, $assistant=true) {
        if($assistant) {
            return $this->get_items(array('UserName'=>$username, 'IsConfirmed'=>1));
        }else {
            return $this->get_items(array('assistantUserName'=>$username));
        }
    }
}